// Copyright 2019 The rhyme_lph Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// e [author] rhyme_lph
// s [email]  rhymelph@gmail.com
// t [github] https://github.com/rhymelph

import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/common/config.dart';
import 'package:finance_app/src/widgets/common_app_bar.dart';
import 'package:flutter/material.dart';
import 'package:finance_app/src/provider/setting/preference/template_style_detail_provider.dart';
import 'package:finance_app/src/router_gen/router_meta.dart';

@RouterMeta(paramName: "templateStyleDetailPage")
class TemplateStyleDetailPage extends StatefulWidget {
  final String title;
  final String imageUrl;

  const TemplateStyleDetailPage({Key key, this.title, this.imageUrl})
      : super(key: key);

  @override
  _TemplateStyleDetailPageState createState() =>
      _TemplateStyleDetailPageState();
}

class _TemplateStyleDetailPageState extends State<TemplateStyleDetailPage>
    with PagePresenter<TemplateStyleDetailPage, TemplateStyleDetailProvider> {
  @override
  PreferredSizeWidget get appBar => getDefaultAppBar(
        title: widget.title,
      );

  @override
  Widget get buildWidget => ColoredBox(
        color: Colors.white,
        child: ListView(
          children: [
            Center(
              child: Container(
                width: getDp(335),
                height: getDp(475),
                child: Image(
                  image: Config.toImageProvider(widget.imageUrl),
                  width: getDp(335),
                  height: getDp(475),
                  fit: BoxFit.contain,
                ),
              ),
            ),
          ],
        ),
      );
}
